package demo4;

import java.text.BreakIterator;

public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog("旺财",3);
        Bird bird =  new Bird("小飞飞",1);
        Duck duck = new Duck("唐老鸭",5);
        walk(dog);
        walk(duck);
        fly(bird);
        fly(duck);
    }
    public static void walk(IRunning iRunning) {
        iRunning.run();
    }

    public static void fly(IFlying iFlying) {
        iFlying.fly();
    }
}
